package com.cosmoplat.mom.iot.client.api.param;

import com.cosmoplat.mom.iot.client.IotApi;
import com.cosmoplat.mom.iot.client.constants.IotApis;
import com.cosmoplat.mom.iot.client.http.HttpRequest;
import com.cosmoplat.mom.iot.client.utils.ParamUtil;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * @author yotta
 * @date 2025/6/16
 */
@EqualsAndHashCode(callSuper = true)
@Data
public class AuthParam extends BaseIotParam {

    private String account;
    private String password;
    private String tenantCode;
    private String type;
    private String source;


    @Override
    public void check() {
        ParamUtil.notBlank(account, "account can not be blank");
        ParamUtil.notBlank(password, "password can not be blank");
        ParamUtil.notBlank(tenantCode, "tenantCode can not be blank");
        ParamUtil.notBlank(type, "type can not be blank");
        ParamUtil.notBlank(source, "source can not be blank");
    }

    @Override
    public IotApi api() {
        return IotApis.AUTH;
    }

    @Override
    public HttpRequest customizeHttpRequest(HttpRequest request) {
        return request.body(this);
    }


}
